//
//  ReciverMain.swift
//
//  Created by 邱仙凯 on 2021/8/6
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct ZyaReciverMain: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let zProvince = "z_province"
    static let zLinkmanNm = "z_linkman_nm"
    static let zLinkmanTel = "z_linkman_tel"
    static let zCity = "z_city"
    static let zLinkmanAddress = "z_linkman_address"
    static let zDistrict = "z_district"
  }

  // MARK: Properties
  public var zProvince: String?
  public var zLinkmanNm: String?
  public var zLinkmanTel: String?
  public var zCity: String?
  public var zLinkmanAddress: String?
  public var zDistrict: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    zProvince <- map[SerializationKeys.zProvince]
    zLinkmanNm <- map[SerializationKeys.zLinkmanNm]
    zLinkmanTel <- map[SerializationKeys.zLinkmanTel]
    zCity <- map[SerializationKeys.zCity]
    zLinkmanAddress <- map[SerializationKeys.zLinkmanAddress]
    zDistrict <- map[SerializationKeys.zDistrict]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = zProvince { dictionary[SerializationKeys.zProvince] = value }
    if let value = zLinkmanNm { dictionary[SerializationKeys.zLinkmanNm] = value }
    if let value = zLinkmanTel { dictionary[SerializationKeys.zLinkmanTel] = value }
    if let value = zCity { dictionary[SerializationKeys.zCity] = value }
    if let value = zLinkmanAddress { dictionary[SerializationKeys.zLinkmanAddress] = value }
    if let value = zDistrict { dictionary[SerializationKeys.zDistrict] = value }
    return dictionary
  }

}
